{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}

{% block title %}万屏时代OPC--项目发布日志{% endblock %}

{% block panel_heading %}
  万屏时代OPC--项目发布日志
{% endblock %}

{% block panel_body %}
    <form action="{{ url_for('auth_bp.publish_demand_logs') }}" method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(form.admin_id, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.demand_id, div_col=4, label_col=4, field_col=7) }}
        <div class="btn-group">
            <button type="submit" class="btn btn-info"
                    id="query-demand-btn">
                查询
            </button>
        </div>
    </form>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'auth_bp.publish_demand_logs', **url_kwargs) }}
    </div>
    {% endif %}

    <table class="table table-bordered table-hover table-condensed table-striped">
        <thead>
            <tr>
                <th>发布者</th>
                <th>项目ID</th>
                <th>原项目状态</th>
                <th>新项目状态</th>
                <th>发布时间</th>
                <th>发布次数</th>
                <th>通知方式</th>
                <th>是否扣费</th>
            </tr>
        </thead>
        <tbody>
            {% for each in data %}
            <tr>
                <td>{{ each.admin.nickname }}</td>
                <td>{{ each.demand_id }}</td>
                <td>{{ each.old_demand_status_display }}</td>
                <td>{{ each.new_demand_status_display }}</td>
                <td>{{ each.published_datetime }}</td>
                <td>{{ each.published_count }}</td>
                <td>{{ each.notice_way_display }}</td>
                <td>{{ each.notice_pay }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'auth_bp.publish_demand_logs', **url_kwargs) }}
    </div>
    {% endif %}
{% endblock %}

